import network from '../../utils/network.js';
const app = getApp();

Page({
  data: {
    userInfo: [],
    qrcode:'',
  },

  onLoad: function (options) {
    var that = this;
    wx.getStorage({
      key: 'user',
      success: function (res) {
        var data = {"uid":res.data.id};
        network.requestLoading('http://jbc.com/api/User/getQrCode', data, "加载中", function (res) {
          console.log(res);
          if (res.status  == 1) {
            that.setData({
              qrcode: res.qrcode,
            });
          } else {
            wx.showToast({
              title: '加载数据失败',
            });
          }
        }, function (res) {
          wx.showToast({
            title: '加载数据失败',
          })

        });
        // that.setData({
        //   userInfo: res.data,
        //   login: true,
        // });
      },
      error: function (e) {
        wx.showToast({
          title: '操作失败',
        });
      }
    }); 
  },
  

})